package com.xnyzc.lhy.common.penum.work;

/**
 * 接单状态
 * zhuyubin
 */
public enum EAcceptOrderType {

    yes(0, "开始接单"),
    no(1, "停止接单");

    private Integer type;
    private String value;

    EAcceptOrderType(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public static EAcceptOrderType findById(Integer type) {
        EAcceptOrderType eAcceptOrderType;
        switch (type) {
            case 0:
                eAcceptOrderType = EAcceptOrderType.yes;
                break;
            case 1:
                eAcceptOrderType = EAcceptOrderType.no;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eAcceptOrderType;
    }

    public static EAcceptOrderType findByIdShow(Integer type) {
        EAcceptOrderType eAcceptOrderType;
        switch (type) {
            case 0:
                eAcceptOrderType = EAcceptOrderType.no;
                break;
            case 1:
                eAcceptOrderType = EAcceptOrderType.yes;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eAcceptOrderType;
    }

    public String getValue() {
        return this.value;
    }

    public Integer getType() {
        return this.type;
    }
}
